goog.provide('dkpoints.admin.upload');

goog.require('goog.dom');

goog.require('dkpoints.raid.driver');
goog.require('dkpoints.errors');
goog.require('soy');


// Module name. Used by the Place manager.
dkpoints.admin.upload.name = "/admin/upload";

/**
 * Load up the Upload Raid UI
 * @param {string} address The current page's address.  Used for param checking.
 */
dkpoints.admin.upload.loadUI = function(address) {
  var me = dkpoints.admin.upload;
  var driver = dkpoints.raid.driver;
  
  // URL Pattern:
  //   /admin/upload      - Show import screen.
  //   /admin/upload/new  - Show the raid view
  
  var driverOpts = {};
  if(/\/new/.test(address)) {
    driverOpts.showNew = true;
  }
  else {
    driverOpts.showUpload = true;
  }
  
  driverOpts.editAuth = true;
  driver.init(driverOpts);
};

dkpoints.admin.upload.teardown = function() {
  dkpoints.raid.driver.teardown();
};